// 引用组件
import Vue from 'vue'
import Router from 'vue-router'

// Vue使用组件
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Login',
      component: () => import('../components/Login')
    }, {
      path: '/main',
      name: 'Main',
      component: () => import('../components/Main'),
      children: [{
        path: 'user',
        name: 'User',
        component: () => import('../components/User')
      }, {
        path: 'emp',
        name: 'Emp',
        component: () => import('../components/Emp')
      }, {
        path: 'role',
        name: 'Role',
        component: () => import('../components/Role')
      }, {
        path: 'personal',
        name: 'Personal',
        component: () => import('../components/Personal')
      }, {
        path: 'product',
        name: 'Product',
        component: () => import('../components/Product')
      }, {
        path: 'buy',
        name: 'Buy',
        component: () => import('../components/Buy')
      }, {
        path: 'buys',
        name: 'Buys',
        component: () => import('../components/Buys')
      }, {
        path: 'password',
        name: 'Password',
        component: () => import('../components/Password')
      }]
    }
  ]
})
